<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<style type="text/css">
			.mui-content {
				background: url(images/login-header.png)no-repeat;
				background-size: 100%;
				padding-top: 170px;
			}
			
			.mui-icon {
				color: #007aff;
			}
			
			h1 {
				font-size: 30px;
				color: #007aff;
				text-align: center;
				font-weight: 200;
				padding-bottom: 30px;
			}
			
			h1 .line {
				position: relative;
				top: 4px;
				display: inline-block;
				height: 30px;
				width: 2px;
				background: #007aff;
				margin: 0 10px;
			}
			
			.item {
				padding: 0 10%;
				display: flex;
				justify-content: center;
			}
			
			.item-img {
				flex: 1;
			}
			
			.item input {
				flex: 9;
				border: none;
				background: inherit;
				border-radius: 0px;
				border-bottom: 1px solid #007aff;
			}
			
			.item .mui-icon {
				line-height: 32px;
				font-size: 40px;
				padding-right: 10px;
			}
			
			.btn {
				padding: 30px 10% 0;
			}
			
			.mui-btn {
				border-radius: 40px;
				padding: 10px;
			}
			
			.register {
				background: inherit;
				color: #007aff;
			}
			
			#footer {
				background: url(images/login-footer.png)right 15px no-repeat;
				background-size: 60%;
				height: 200px;
				text-align: center;
			}
			
			#footer span {
				color: #007aff;
				line-height: 20px;
			}
			
			#footer .line {
				display: inline-block;
				height: 14px;
				width: 1px;
				background: #007aff;
				margin: 0 10px;
			}
		</style>
	</head>

	<body>
		<div class="mui-content">
			<div class="content" id="app">
				<h1><span>企业登录</span><em class="line"></em><span>LOGIN</span></h1>

				<div class="item">
					<div class="item-img">
						<i class="mui-icon mui-icon-contact"></i>
					</div>
					<input type="text" id="account" value="" />
				</div>
				<div class="item">
					<div class="item-img">
						<i class="mui-icon mui-icon-locked"></i>
					</div>
					<input type="password" name="" id="passwrod" />
				</div>

				<div class="btn">
					<button type="button" id="login" class="btn_open mui-btn mui-btn-blue mui-btn-block">确认登录</button>
				</div>
				<div id="footer">
					<span class="btn_open">企业注册</span><em class="line"></em><span class="btn_open">忘记密码<i class="mui-icon mui-icon-help"></i></span></span>
				</div>
			</div>
		</div>

	</body>

</html>

<script src="js/mui.min.js"></script>
<script src="js/vue.js"></script>
<script type="text/javascript">
	mui.init({
		beforeback: function() {　　　　
			var list = plus.webview.getWebviewById('my.html');
			mui.fire(list, 'shuaxin');
			//返回true,继续页面关闭逻辑
			return true;
		}
	});
	mui(".content").on('tap', '.btn_open', function() {
		if(this.innerText === '确认登录') {
			tijiao()
		} else if(this.innerText === '企业注册') {
			tiao('qiyezhuce1');
		} else if(this.innerText === '忘记密码') {
			mui.toast('该功能暂停开放')
			//			tiao('*****');
		}
	})

	function tijiao() {
		if(mui("#account")[0].value&&mui("#passwrod")[0].value){
			
		
		mui.ajax(URL + 'meGeneralUser!loginGenUser', {
			data: {
				comPhone: mui("#account")[0].value,
				comPassword: mui('#passwrod')[0].value,
			},
			dataType: 'json', //服务器返回json格式数据
			type: 'post', //HTTP请求类型
			timeout: 10000, //超时时间设置为10秒；
			success: function(data) {
				if(data.success) {
					var ddd = JSON.stringify(data.clazz);
//					console.log(JSON.stringify(data));
					apage = plus.webview.getWebviewById("my.html");
					cun('TOKEN', ddd);
					mui.back();

				}
				mui.toast(data.msg);
			},
			error: function(xhr, type, errorThrown) {
				console.log(type,errorThrown);

			}
		});
		}else{
			mui.toast('请填写账号或密码')
		}
	}
</script>